import "package:ct_pa_majordomo/config/theme_vars.dart";
import "package:ct_pa_majordomo/widgets/divider/solid_divider.dart";
import "package:flutter/material.dart";

void showDetail({
  required BuildContext context,
  required Map record,
  ValueChanged<String>? onChange,
}) async {
  showDialog(
      context: context,
      builder: (BuildContext context) {
        return Dialog(
          shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(10)),
          ),
          child: Container(
            child: ListView(
              shrinkWrap: true,
              children: [
                const Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Padding(
                      padding: EdgeInsets.symmetric(vertical: 10),
                      // child: Text("电表名称", style: TextStyle(fontSize: 18),),
                    ),
                  ],
                ),
                Center(
                  child: Column(
                    children: [
                      // Text("抄表总电量：${record["total"]}度", style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 16),),
                      // const SizedBox(height: 6,),
                      Text("用电量：${record["kwh"]}度", style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 16),),
                      const SizedBox(height: 6,),
                      Text("${record["useTime"]}", style: const TextStyle(fontSize: 14),),
                      const SizedBox(height: 12,),
                    ],
                  )
                ),
                const SolidDivider(),
                SizedBox(
                  height: 50,
                  child: Row(
                    children: [
                      Expanded(
                        child: TextButton(
                            onPressed: () {
                              Navigator.of(context).pop();
                            },
                            child: const Text("确定")
                        ),
                      ),
                    ],
                  ),
                )
              ],
            ),
          ),
        );
      }
  );
}